
import java.io.File;
import java.util.ArrayList;

public class MainProgram {

    public static void main(String[] args) {

        try {
            DNSRA_M1_JAVA program = new DNSRA_M1_JAVA();
            File inputPath = new File("../InputFiles");
            String[] fileNames = inputPath.list();
            for (int i = 0; i < fileNames.length; i++) {
                if (fileNames[i].endsWith(".fna")) {
                    long startTime = System.currentTimeMillis();
                    ArrayList<ReadString> arr = program.ReadFile(new File(inputPath.getAbsolutePath(), fileNames[i]));
                    program.ArraySort(arr);
                    ArrayList<String> arraylist = program.greedy_sequencer_B2(arr, 10, 0);
                    //ArrayList<String> arraylist = program.greedy_sequencer_B1(arr, 18, 29);
                    long runningTime = (System.currentTimeMillis() - startTime) / 1000;
                    program.WriteOutputToFile(fileNames[i], runningTime, arraylist);
                    System.out.print("finish " + fileNames[i]);
                }
            }
        } catch (Exception e) {
            System.out.print("Error " + e.getMessage());
            e.printStackTrace();
        }

    }
}
